<?php
/**
 * ブートストラップ
 *
 * LICENSE: Miracle Maple by Mirage is licensed
 * under a Creative Commons 表示-非営利-継承 2.1 日本 License.
 *
 * @category   bootstrap
 * @package    maple-story.jp
 * @version    8.0.0
 * @since      File available since Release 8.0.0
 * @copyright  Copyright 2011 Miracle Maple
 * @license    http://creativecommons.org/licenses/by-nc-sa/2.1/jp/     Creative Commons BY-NC-SA
 */
class Bootstrap_Resource_Constant extends Zend_Application_Resource_ResourceAbstract
{
    public function init()
    {
        $this->_setConstant($this->getOptions());
    }
    
    /**
     * 定数をレジストリに保存
     * @return   void
     */
    private function _setConstant($options = null)
    {
        $registry = new Zend_Registry();
        
        if (array_key_exists('debug', $options)) {
            $registry->set('DEBUG_MODE', $options['debug']);
        } else {
            $registry->set('DEBUG_MODE', false);
        }
        
        // ページ情報
        $registry->set('DEFAULT_TITLE', $options['title']);
        $registry->set('DEFAULT_KEYWORDS', $options['keywords']);
        $registry->set('DEFAULT_DESCRIPTION', $options['description']);
    }

}
